﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Operator.OperatorLoginHistoryUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="282" d:DesignWidth="1200">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="3">
            <TextBlock Text="工号:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbNumber" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="结果：" Margin="3" VerticalAlignment="Center" />
            <ComboBox Name="tbResult" Margin="3" VerticalAlignment="Center" Width="100">
                <ComboBoxItem>所有</ComboBoxItem>
                <ComboBoxItem>失败</ComboBoxItem>
                <ComboBoxItem>成功</ComboBoxItem>
                <ComboBox.SelectedIndex>0</ComboBox.SelectedIndex>
            </ComboBox>
            <TextBlock Text="登录时间：" Margin="3" VerticalAlignment="Center"/>
            <DatePicker Name="dpStart" Margin="3" VerticalAlignment="Center" Width="130"/>
            <TextBlock Text="到：" Margin="3" VerticalAlignment="Center"/>
            <DatePicker Name="dpEnd" Margin="3" VerticalAlignment="Center" Width="130"/>
            <Button Name="btnQuery" Content="查询" Margin="3" VerticalAlignment="Center" Click="btnQuery_Click" Width="60"/>
        </StackPanel>
        <DataGrid Grid.Row="1" GridLinesVisibility="All" Name="dgvLoginHistories" AutoGenerateColumns="False" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="编号" Binding="{Binding Path=Id}"/>
                <DataGridTextColumn Header="工号" Binding="{Binding Path=Operator}"/>
                <DataGridTextColumn Header="IP地址" Binding="{Binding Path=IpAddress}"/>
                <DataGridTextColumn Header="方式" Binding="{Binding Path=Source}"/>
                <DataGridTextColumn Header="时间" Binding="{Binding Path=Time,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                <DataGridTextColumn Header="结果" Binding="{Binding Path=Result,Converter={StaticResource boolConverter},ConverterParameter=失败|成功}"/>
                <DataGridTextColumn Header="描述" Binding="{Binding Path=Comment}" Width="*"/>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl x:Name="pageBar" Grid.Row="2" PageSize="50" PageChanging="PageBarUserControl_PageChanging" />
    </Grid>
</UserControl>
